package crp.core.workflow.domain.models;

import com.qwlabs.jackson.Jackson;
import com.qwlabs.security.Caller;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;

import java.util.Optional;

@Getter
@Builder
@AllArgsConstructor
public class WorkflowTaskQuery {
    private final Caller caller;
    private final String keyword;
    private final WorkflowTaskStatus taskStatus;
    private final String workflowTopic;
    private final String condition;

    public <T> Optional<T> getConditionBy(Class<T> clazz) {
        return Jackson.read(condition, clazz);
    }
}
